﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using LanguagePolish.EntityModel;

namespace LanguagePolish.Controls.Meta
{
    class ClassroomLessonsProvider : ILessonsProvider
    {
        private readonly Classroom classroom;

        public ClassroomLessonsProvider(Classroom classroom)
        {
            if (classroom == null)
                throw new ArgumentNullException("classroom");
            this.classroom = classroom;
        }

        public IEnumerable<Lesson> GetLessons(DateTime from, DateTime to)
        {
            var res = classroom.Lessons.Where(l => l.LessonDate >= from && l.LessonDate <= to).ToList();
            return res;
        }
    }
}
